#ifndef __MYMATH_H
#define __MYMATH_H
    
#include"type.h" 

#define CRC32_CODE      ((INT32U)0x04C11DB7)

#define CRC16_CODE      0x8408                                               


#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))

extern INT8U  Get_Even(INT8U _data);
extern INT8U  cal_crc8(const INT8U *_ptr,INT8U _len);
extern INT16U cal_crc16(INT8U *_ptr, INT16U _len);
extern INT32U cal_crc32( const INT8U *_data, INT16U _data_len );
extern INT16U my_rand(void);
extern void   my_srand(INT16U _srand_num) ;

extern INT8U  parity_check(INT8U _data);
extern void   bit2byte(INT8U _data, INT8U *_buff);
extern INT8U  get_sqrt(INT16U _dat);
extern INT8U  zeller_formula(INT8U _year, INT8U _month, INT8U _day);

#endif




